package com.aegean.MonitorExamSYS.conduction.action;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.aegean.MonitorExamSYS.center.business.CenterBusiness;
import com.aegean.MonitorExamSYS.conduction.business.ConductionBusiness;
import com.aegean.MonitorExaxSYS.model.ConductionValue;
import com.aegean.MonitorExaxSYS.model.MessageBox;
import com.opensymphony.xwork2.ActionSupport;

@Controller("ShowConductionMessageBox")
@Scope("prototype")
public class ShowConductionMessageBox extends ActionSupport {
	@Resource
	ConductionBusiness business;
	private int status;// 状态
	private int conduction_Id;
	private int state;
	private int start;
	private int limit;
	private int total;
	private ConductionValue conduction;
	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	private List<MessageBox> messages;

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getConduction_Id() {
		return conduction_Id;
	}

	public void setConduction_Id(int conduction_Id) {
		this.conduction_Id = conduction_Id;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public List<MessageBox> getMessages() {
		return messages;
	}

	public void setMessages(List<MessageBox> messages) {
		this.messages = messages;
	}

	public int getStart() {
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public int getLimit() {
		return limit;
	}

	public void setLimit(int limit) {
		this.limit = limit;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		HttpSession session=ServletActionContext.getRequest().getSession();
		conduction=(ConductionValue)session.getAttribute("ConductionLogin");
		messages = business.showMessages(state, status, conduction.getConduction_Id(), start,
				limit);
		total = messages.size();
		return SUCCESS;
	}

}
